package com.leapp.sk.ui.activity.leave

import android.os.Bundle
import android.support.v4.app.Fragment
import com.example.mvp.activity.BaseActivityMVP
import com.example.mvp.binder.BaseDataBinder
import com.leapp.sk.R
import com.leapp.sk.bean.TopLayoutTitleEntity
import com.leapp.sk.binder.BaseBinder
import com.leapp.sk.ui.fragment.leave.ApprovalPendingFragment
import com.leapp.sk.ui.fragment.leave.ApprovedFragment
import com.leapp.sk.ui.fragment.task.submit.SubmitCompleteFragment
import com.leapp.sk.ui.fragment.task.submit.UnSubmitFragment
import com.leapp.sk.viewdelegate.leave.TeacherLeaveDelegate

/**
 * 老师端请假
 * @author  chaohaipeng  on 2018/8/13.
 */
class TeacherLeaveActivity :BaseActivityMVP<TeacherLeaveDelegate>(){
    /**
     * fragment数据集合
     */
    private var fragmentLists = mutableListOf<Fragment>()
    /**
     * 标签集合
     */
    private var titles = mutableListOf<TopLayoutTitleEntity>()
    override fun initDate() {
        fragmentLists.add(ApprovalPendingFragment())
        fragmentLists.add(ApprovedFragment())
        val topULayoutTitleEntity = TopLayoutTitleEntity()
        topULayoutTitleEntity.title = String.format(resources.getString(R.string.string_task_un_approved), 5)
        val topRLayoutTitleEntity = TopLayoutTitleEntity()
        topRLayoutTitleEntity.title = String.format(resources.getString(R.string.string_task_approved_submit), 10)
        titles.add(topULayoutTitleEntity)
        titles.add(topRLayoutTitleEntity)
        viewDelegate.initTabLayout(this,fragmentLists,titles)
    }

    override fun bindEvenListener() {
    }

    override fun getDelegateClass(): Class<TeacherLeaveDelegate> {
        return TeacherLeaveDelegate::class.java
    }

    override fun getDataBinder(): BaseDataBinder<*, *> {
        return BaseBinder()
    }

    override fun initView(p0: Bundle?) {
        viewDelegate.setTitle(resources.getString(R.string.string_level_level))
    }
}